Skip to content

Conversation

martakam
Copy link
Member

@martakam martakam commented Sep 16, 2026

This PR adds pagination so we can look through more books when there are more than 12 results.
Some changes in the API so we support looking for a specific page by using the page search param.

A natural place for the current page state would be BookGrid. However, we want to remember the page we were on when we're done with looking at a specific book's details. That's why the state has been moved to the parent component. See 80fd2ed

@martakam martakam requested a review from a team as a code owner September 16, 2026 15:40
@martakam martakam self-assigned this Sep 16, 2026
@martakam martakam added the enhancement New feature or request label Sep 16, 2026
@martakam martakam linked an issue Sep 16, 2026 that may be closed by this pull request
Copy link
Member

@johahor johahor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the application, and when i browse between different pages it briefly says "no books found for this search". While the query runs the data is undefined for a moment, and since isLoading were moved after the !data check, this happens between browsing.

@martakam martakam requested a review from johahor September 16, 2026 20:03
@martakam
Copy link
Member Author

I wanted the pagination to be showed while loading, but that doesn't really seem possible without a lot of extra code for such a small feature, so I prefer we just show a general "Loading books..." when we switch pages.

@hestro hestro self-requested a review September 16, 2026 22:08
Copy link
Member

@hestro hestro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great, approved! Agreed on keeping it simple with "Loading books..." on page switches

Copy link
Member

@johahor johahor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes works perfect, good work. Agreed on leaving as is for now. "Loading books.." is fine for this project, and we can improve the pagination in the next one.

@martakam martakam merged commit 6d2893f into main Sep 17, 2026
@martakam martakam deleted the feat/pagination branch September 17, 2026 22:38
Sign in to join this conversation on GitHub.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: multiple pages for books
3 participants